arr_1 = input('input an integer array: ')
arr = [int(n) for n in arr_1.split()]
target = input('input a int:')

# for idx,i in enumerate(arr):
#     print(arr[idx])
#     # print(idx,i)

for i in range(len(arr)):
    # print('i:',i)
    for j in range(len(arr)):
        # print('j:',j)
        if target == arr[i]+arr[j] and i != j:
            # pass
            print(arr[i])
            print(arr[j])